package com.ww.scm.repository.mat;

import java.util.Date;

import org.springframework.stereotype.Component;

import com.ww.core.orm.hibernate.HibernateDao;
import com.ww.core.utils.DateUtils;
import com.ww.scm.constants.Constants;
import com.ww.scm.entity.mat.TransactionDetail;

//Spring Bean的标识.
@Component
public class TransactionDetailRepository  extends HibernateDao<TransactionDetail, String>{
	

	public void delete(TransactionDetail transactionDetail, String operator) {
		Date nowDate = new Date();
		transactionDetail.setSysFlag(Constants.SYS_FLAG_DELETED);
		transactionDetail.setLastModifier(operator);
		transactionDetail.setLastModifiedTime(DateUtils.formatDateHms(nowDate));
		save(transactionDetail);
	}

	public void delete(String id, String operator) {
		TransactionDetail transactionDetail = get(id);
		delete(transactionDetail, operator);
	}
}
